The following example creates a simple Java application that includes two text boxes. An IDL command typed in the top textbox is passed to the IDL process through the use of the executeString method. Command output and any error messages are printed in the bottom textbox.
Note: The file for this example, JIDLCommandLine.java, is located in the examples/doc/bridges/java subdirectory of the IDL distribution.
JIDLCommandLine.java in the location referenced above:cmd in the textbox.JIDLCommandLine.java file.cd IDL_DIR\examples\doc\bridges\java
IDL_DIR is the directory where you have installed IDL.
javaidlb.jar in the compile statement. This automatically accesses the connector object, java_IDL_connect, which is contained within the file. Enter the following two commands (as single lines) to compile and execute the program, replacing IDL_DIR with the IDL installation directory:javac -classpath ".;IDL_DIR\resource\bridges\export\java\javaidlb.jar" JIDLCommandLine.java
java -classpath ".;IDL_DIR\resource\bridges\export\java\javaidlb.jar" JIDLCommandLine
Note: See Note on Running the Java Examples for information on executing Java commands on a non-Windows platform.
After compiling and running the project, a simple command line interface appears as shown in the following figure.
Send commands to the IDL process by entering them in the top text box and pressing the Enter key. Any output or errors will appear in the lower text field.